home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 19 / Amiga Format CD19 (1997-10-02)(Future Publishing)(GB)(Track 1 of 5)[!][issue 1997-11].iso / -seriously_amiga- / shareware / misc / uninstaller / uninstallergr.rexx < prev   
OS/2 REXX Batch file  |  1997-08-26  |  3KB  |  86 lines

  1. /* UnInstaller v1.0 by Panokostas Dimitris */
  2.  
  3. Options Results
  4. addlib("libs:rexxsupport.library", 0, -30, 34)
  5. addlib("libs:rexxreqtools.library", 0, -30, 0)
  6. NL='0a'x
  7. rtezrequest("Êáëþò Þëèáôå óôïí UnInstaller v1.0." || NL ||,
  8.              "Äçìéïõñãßá ôïõ Ðáíïêþóôá ÄçìÞôñç óôï 1997","ÓõíÝ÷åéá")
  9. rtezrequest("ÐñÝðåé íá ïñéóôåß Ýíá Installer logfile","ÅðéëïãÞ logfile | Áêýñùóç")
  10. if rtresult=0 then call Finished
  11. logfile=rtfilerequest(, , "ÅðéëÝîôå Ýíá Installer logfile", ,)
  12. if logfile="" then call Finished
  13. open(1,logfile,"R")
  14. i=0;d=0
  15. do until eof(1)
  16.   OneLine=ReadLN(1)
  17.   If Index(OneLine,"ÁíôéãñáöÞ")>0 then do
  18.     i=i+1
  19.     InstFileTmp=substr(OneLine,pos('"',OneLine),(pos('"',OneLine,(pos('"',OneLine)+1)))-(pos('"',OneLine)-1))
  20.     InstPath=Strip(substr(OneLine,pos("óôï",OneLine)+4),,".")
  21.     If LastPos("/",InstFileTmp)>0 then InstFile=SubStr(InstFileTmp,LastPos("/",InstFileTmp)+1)
  22.     If LastPos(":",InstFileTmp)>0 then InstFile=SubStr(InstFileTmp,LastPos(":",InstFileTmp)+1)
  23.     If LastPos(":",InstFileTmp)=0 then InstFile=InstFileTmp
  24.     If Right(InstPath,2)~='/"' & Right(InstPath,2)~=':"' then InstPath=Strip(InstPath,,'"')||"/"
  25.     InstFull.I=strip(InstPath,,'"')||strip(InstFile,,'"')
  26.   end
  27.     If Index(OneLine,"Äçìéïõñãßá êáéíïýñãéïõ óõñôáñéïý")>0 then do
  28.     d=d+1
  29.     InstDrawer.d=strip(substr(OneLine,pos('"',OneLine),(pos('"',OneLine,(pos('"',OneLine)+1)))-(pos('"',OneLine)-1)),,'"')
  30.   end
  31. end
  32. If I>0 then
  33.   do j=1 to i
  34.         rtezrequest("ÄéáãñáöÞ áõôïý ôïõ áñ÷åßïõ;" || NL ||,
  35.                     InstFull.j,"Áêýñùóç | Íáé | ¼÷é | ÄéáãñáöÞ ¼ëùí")
  36.  
  37.   if rtresult=1 then call Finished
  38.   if rtresult=0 then rtezrequest("Åßóôå óßãïõñïò ãéá áõôü;","Íáé | ¼÷é")
  39.         if rtresult=1 then do
  40.           j=i
  41.           call DeleteAll
  42.           call DrawerCleanUp
  43.         end
  44.   if rtresult=2 then do
  45.         if exists(InstFull.j) then delete(InstFull.j)
  46.   end
  47.   if rtresult=3 then noop
  48. end
  49. Call DrawerCleanUp
  50.  
  51. DrawerCleanUp:
  52. If D>0 then
  53.   do j=1 to d
  54.         rtezrequest("ÄéáãñáöÞ áõôïý ôïõ êáôáëüãïõ;" || NL ||,
  55.                     InstDrawer.j,"Áêýñùóç | Íáé | ¼÷é | ÄéáãñáöÞ ¼ëùí")
  56.  
  57.   if rtresult=1 then call Finished
  58.   if rtresult=0 then rtezrequest("Åßóôå óßãïõñïò ãéá áõôü;","Íáé | ¼÷é")
  59.         if rtresult=1 then do
  60.           j=d
  61.           call DeleteAllDrawers
  62.           call Finished
  63.         end
  64.   if rtresult=2 then do
  65.         if exists(InstDrawer.j) then delete(InstDrawer.j)
  66.         if exists(InstDrawer.j||".info") then delete(InstDrawer.j||".info")
  67.   end
  68.   if rtresult=3 then noop
  69. end
  70. Call Finished
  71.  
  72. Finished:
  73. rtezrequest("ÔÝëïò Åñãáóßáò!")
  74. exit
  75.  
  76. DeleteAll:
  77. do j=1 to i
  78.         if exists(instfull.j) then delete(InstFull.j)
  79. end
  80.  
  81. DeleteAllDrawers:
  82. do j=1 to d
  83.         if exists(InstDrawer.j) then delete(InstDrawer.j)
  84.         if exists(InstDrawer.j||".info") then delete(InstDrawer.j||".info")
  85. end
  86.